package com.byl.modules.sys.service.impl;

import com.byl.modules.sys.dao.TemplateDao;
import com.byl.modules.sys.service.TemplateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2019/8/20.
 */
@SuppressWarnings("ALL")
@Service
public class TemplateServiceImpl implements TemplateService {
    @Autowired
    TemplateDao templateDao;

    @Override
    public List listTemplate() {
        return templateDao.listTemplate();
    }

    @Override
    public int saveTemplate(Map map) {
        return templateDao.saveTemplate(map);
    }

    @Override
    public int deleteTemplate(String id) {
        return templateDao.deleteTemplate(id);
    }

    @Override
    public int checkTemplate(String template_name) {
        return templateDao.checkTemplate(template_name);
    }

    @Override
    public List listField(String tid) {
        return templateDao.listField(tid);
    }

    @Override
    public int saveField(Map map) {
        return templateDao.saveField(map);
    }

    @Override
    public int updateField(Map map) {
        return templateDao.updateField(map);
    }

    @Override
    public int deleteField(String id) {
        int rs=templateDao.queryTemplateMapping(id);
        if(rs>0)
            return -1;
        return templateDao.deleteField(id);
    }

    @Override
    public List listOption(String fid) {
        return templateDao.listOption(fid);
    }

    @Override
    public int saveOption(Map map) {
        return templateDao.saveOption(map);
    }

    @Override
    public int updateOption(Map map) {
        return templateDao.updateOption(map);
    }

    @Override
    public int deleteOption(String id) {
        return templateDao.deleteOption(id);
    }
}
